The present invention pertains to a method and apparatus for maintaining audio sample correlation, and more particularly, to a method and apparatus for maintaining input and output audio sample correlation for echo cancellation.
Referring to FIG. 1, a general block diagram of a speaker phone system is shown. User A has a speaker 21a and microphone 23a while User B has his/her own speaker 21b and microphone 23b. User A and User B are coupled together via a transmission medium 20 such as the Internet or telephone system (e.g., Plain Old Telephone Service or POTS). When an input signal is received at microphone 23a (e.g., when User A speaks), there is a possibility that the sound being emitted by speaker 21a will also be received as an input signal at microphone 23a thus causing an echo at User B. To control this echo, an echo cancellation component (EC) 25a receives the input signal from microphone 23a and the signal being output to speaker 21a. Accordingly, echo cancellation component 25a cancels the signal output by speaker 21a from the input signal at microphone 23a (i.e., eliminates the echo that would be perceived by User B if the input signal did not go through this processing). A similar echo cancellation component 25b is provided for User B.
Referring to FIG. 2, a known system for implementing a speaker phone with echo cancellation is shown. The system includes a coder/decoder (codec) 15 coupled to an audio output device (e.g., speaker 16) and an audio input device (e.g., microphone 17). A central processing unit (CPU) 11 is also provided coupled to one or more buses 10. A component including a device driver 13 is coupled to bus 10 and performs a variety of functions to facilitate the sending and receiving of data buffers to and from codec 15. A memory device 19 such as Random Access Memory (RAM) is coupled to bus 10 and is used to store data that is sent to and from codec 15 by device driver 13. During the operation of the system in FIG. 2, incoming data from transmission medium 8 is received by transceiver 9 and placed in buffer RD. The protocol information from the incoming data is "stripped" away and the data is placed in an output buffer OUT.
The output buffer (OUT) for speaker 16 flows to codec 15 and to speaker 16. If the system of FIG. 2 is used in a speaker phone application, there is a substantial possibility that sound emitted from speaker 16 will be received as input to microphone 17. Correlated input/output buffers (e.g., for time t.sub.1) are created at codec 15 and sent back to memory 19. Referring back to FIG. 2, echo cancellation component 12 operates on correlated samples which includes an audio input sample and the audio output sample which was playing at the time the input sample was taken. These samples are typically provided in correlated buffers stored in memory 19. For example, an input buffer of 256 samples taken at time t.sub.1 (IB.sub.1) can be stored adjacent to a correlated output buffer of 256 samples output at time t.sub.1 (OB.sub.1) in memory 19. Likewise, additional input and output buffers can be stored for times t.sub.2 to t.sub.n. The echo cancellation component 12 accesses the correlated input/output buffers of memory 19 and generates the appropriate output data to be sent to the end user which is placed in buffer SD. The proper protocol information is added to buffer SD and the outgoing data is sent by transceiver 9 over transmission medium 8. In the system of FIG. 2, there are several quantities of data flowing to and from codec 15. Thus, at least three buffers of data (OUT, IB.sub.1, and OB.sub.1) flow between codec 15 and device driver 13. If the codec resides in a modem coupled to bus 10 via a serial channel, the amount of data flowing to and from codec 15 may exceed the available bandwidth available across the serial channel, thus degrading performance.